﻿using SQ.Domain;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SQ.Infrastructure.Mappings
{
    public class EnderecoMap : EntityTypeConfiguration<Endereco>
    {
        public EnderecoMap()
        {
            ToTable("TB_ENDERECO");

            HasKey(x => x.Id);

            Property(x => x.Id).HasColumnName("ID_ENDERECO");
            Property(x => x.EnderecoComercial).HasMaxLength(30).IsRequired().HasColumnName("END_COMERCIAL");
            Property(x => x.CEP).IsRequired().HasColumnName("END_CEP");
            Property(x => x.Cidade).HasMaxLength(20).IsRequired().HasColumnName("END_CIDADE");
            Property(x => x.Complemento).HasMaxLength(20).IsRequired().HasColumnName("END_COMPL");
            Property(x => x.Estado).HasMaxLength(2).IsRequired().HasColumnName("END_ESTADO");
        }
    }
}
